# 入门

import torch

x = torch.arange(12)

print(x.shape)
# torch.Size([12])

X = x.reshape(3, 4)

print(X)
# tensor([[ 0,  1,  2,  3],
#         [ 4,  5,  6,  7],
#         [ 8,  9, 10, 11]])


X2 = x.reshape(4, 3)
print(X2)
# tensor([[ 0,  1,  2],
#         [ 3,  4,  5],
#         [ 6,  7,  8],
#         [ 9, 10, 11]])

X3 = x.reshape(2, 3, 2)
print(X3)



X4 = x.reshape(3, -1)
print(X4)

X5 = torch.zeros(3, 4);
print(X5)

X6 = torch.ones(3, 4);
print(X6)

# 均值为0,标准差为1的高斯分布
X7 = torch.randn(3, 4);
print(X7)